Python Workbook: Learn How to Quickly and Effectively Program with Exercises, Projects, and Solutions by PROGRAMMING LANGUAGES ACADEMY
Author:PROGRAMMING LANGUAGES ACADEMY [LANGUAGES ACADEMY, PROGRAMMING]
Language: eng
Format: azw3
Published: 2019-12-28T16:00:00+00:00
Is This Correct? - Part 4
Q-1: Below is a user-made function that is designed to iterate through a given range and look for the highest number. Will the function work when it is called?
def high_number(numbers):
max = numbers[0]
for number in numbers:
if number < max:
max = number
return max
list = [21, 200, 31, 1, 39]
high_number(list)
Q-2: What seems to be the issue with the following?
def this_function():
print("Hello From This Function!")
this_function_with_args(name, greeting):
print(f"Hello {name}, From This Function!, I wish you {greeting}")
this_function()
this_function_with_args()
Q-3: What would this function do?
def plus(a,b):
sum = a + b
(sum, a)
sum, a = plus(3,4)
print(sum)
Q-4: Can you place a loop within a function as shown below?
def plus(*args):
total = 0
for i in args:
total += i
return total
print(plus(20,30,40,50))
Now that we have revisited quite a few concepts and methods, and functions as well, let us head over to our final project and see what it is all about.
Final Project – Hangman
Remember the old game called Hangman? The one that involved blanks and a limited number of guesses to guess a movie, a name, a person, a city or something else? For your final project, I decided to come up with a tough one. A project that will use almost everything you have learned.
To make it even better, if you execute the program correctly, you can store it as a recallable function or create a separate package so that you can use this over and over again. While there are hundreds of variations for this game online, use your own unique approach. Feel free to browse the internet to get some inspiration.
Requirements:
You will need to use the following as your first line:
import time
Let this be a project that you are proud of, once it is finished. By the end of this project, rest assured you are ready to take on the challenges and offer some exquisite programming skills to those who require programmers such as yourself.
The journey of a programmer does not end here. There are far too many things that lay ahead which you will need to keep pace with. Learn about various libraries, modules and packages to see how they can bring refinement to your projects.
For those interested in Machine Learning, Automation, Artificial intelligence and Deep Learning, you will come across some names like Scikit-Learn, Turtle and a few more. While it is still too early to jump into these, it is a good idea to have a look at them and see how they perform in action.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(11950)
Hello! Python by Anthony Briggs(9406)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9367)
The Mikado Method by Ola Ellnestam Daniel Brolund(9337)
Dependency Injection in .NET by Mark Seemann(8884)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7879)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7380)
Grails in Action by Glen Smith Peter Ledbrook(7317)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7145)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5988)
Kotlin in Action by Dmitry Jemerov(4669)
Practical Vim (for Kathryn Amaral) by Drew Neil(3739)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3610)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3489)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3266)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(3015)
Learning Java by Patrick Niemeyer & Daniel Leuck(2880)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2856)
Microservices with Go by Alexander Shuiskov(2800)